<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>html</title>
</head>
<body>
    <div id="outer">

    </div>

    <script>
        let div = document.getElementById("outer");
        //鼠标移动
        document.onmousemove=function(event){
            let e = event || window.event;
            //文档可见区域的
            let cx = e.clientX;
            let cy = e.clientY;

            let sx = e.screenX;
            let sy = e.screenY;

            div.innerHTML="cx:"+cx+",cy:"+cy+"=>sx:"+sx+",sy:"+sy; 
        }
    </script>
</body>
</html>